import axios from 'axios'

const service = axios.create({
    //请求超时
    timeout: 3000,

})

//请求拦截
service.interceptors.request.use(
    config => {
        return config
    },
    err => {
        console.log(err);
    }
)
//响应拦截
service.interceptors.response.use(
    response => {
        let res = {}
        res.state = response.status
        res.data = response.data
        return res
    },
    err => console.log(err)
)

export default service